<h4>Tool</h4><table border="0"><tr><td valign="top"><b>Name</b></td><td valign="top">Resection (Terrestrial)</td></tr><tr><td valign="top"><b>ID</b></td><td valign="top">0</td></tr><tr><td valign="top"><b>Author</b></td><td valign="top">HfT Stuttgart (c) 2013</td></tr></table><hr><h4>Description</h4>Single Image Spatial Resection (Terrestrial): from at least 3 image points with known coordinates, the Cardan angles of the image orientation and the coordinates of the perspective center are calculated by a least-squares adjustment. The Cardan angles refer to the following transformation between image coordinates (x_image) and global coordinates (X_Global): 
	 x_image = R_1(omega) * R_2(kappa) * R_3(alpha) * X_Global 
 Here R_1, R_2, R_3 denote rotation matrices of a right-handed (passive) coordinate transformation.

The inputs consist of a point cloud containing the identical points with their pixel indices as additional attributes. The origin of pixels is in the lower left corner of the image. The interior orientation parameters of the camera is to be provided. These include Focal Length (mm), Pixel Size (um), Principal Point Offsets (pixels) and optionally the Radial Distortion Parameters. The distortion model being used is as follows: 
	 x_d = x_u (1 - dR)
	 y_d = y_u (1 - dR) 
 where, dR = K1 * r_u ^ 2 + K2 * r_u ^ 4 + K3 * r_u ^ 6,
 r_u ^ 2  = x_u ^ 2 + y_u ^ 2,
 x_u, y_u are the undistorted (corrected) image coordinates in mm,
 x_d, y_d are the distorted (observed) image coordinates in mm,
 K1 is in [mm ^ -2], K2 is in [mm ^ -4],  K3 is in [mm ^ -6].
Approximate coordinates in [m] for the Projection Center and the center of image are also to be provided.

Following the adjustment the results are written to a text file. The main contents of the text file are: for each iteration the Sum of Squared Residuals, the A-Posteriori Standard Deviation (Sigma Naught) and the Condition of Normal Matrix, and the final estimated exterior orientation parameters (Xc, Yc, Zc, Omega, Kappa, Alpha).

 Optionally the Principal Point Offsets can be estimated. This requires at least 4 image points as input.

[Warning] The tool is dedicated to the terrestrial case which means the viewing direction must be sufficiently different from the vertical direction.
The estimation of Principal Point Offsets is not recommended if the condition of the Normal Matrix is less than 10 ^ -7.

<hr><h4>Parameters</h4><table border="1" width="100%" valign="top" cellpadding="5" rules="all"><tr><th>Name</th><th>Type</th><th>Identifier</th><th>Description</th><th>Constraints</th></tr>
<tr><th colspan="5">Input</th></tr><tr><td>Measured Points (PC) </td><td>Point Cloud (input)</td><td>POINTS</td><td>List of Measured Points as PC</td><td></td></tr><tr><th colspan="5">Options</th></tr><tr><td>Focal Length (mm)</td><td>Floating point</td><td>F</td><td>Focal Length in mm</td><td>Default: 0.000000</td></tr><tr><td>Pixel Width (um)</td><td>Floating point</td><td>W</td><td>Pixel Width in micro meters</td><td>Default: 0.000000</td></tr><tr><td>Estimate Principal Point Offsets?</td><td>Boolean</td><td>EST_OFFSETS</td><td>Do you wish to estimate Principal Point Offsets?</td><td>Default: 0</td></tr><tr><td>Principal Point Offset in X (pixels)</td><td>Floating point</td><td>ppX</td><td>Principal Point Offset in X</td><td>Default: 0.000000</td></tr><tr><td>Principal Point Offset in Y (pixels)</td><td>Floating point</td><td>ppY</td><td>Principal Point Offset in Y</td><td>Default: 0.000000</td></tr><tr><td>Provide Radial Distortion Parameters?</td><td>Boolean</td><td>GIVE_DISTORTIONS</td><td>Do you wish to provide the Radial Distortion Parameters?</td><td>Default: 0</td></tr><tr><td>K1</td><td>Floating point</td><td>K1</td><td>K1</td><td>Default: 0.000000</td></tr><tr><td>K2</td><td>Floating point</td><td>K2</td><td>K2</td><td>Default: 0.000000</td></tr><tr><td>K3</td><td>Floating point</td><td>K3</td><td>K3</td><td>Default: 0.000000</td></tr><tr><td>X</td><td>Floating point</td><td>Xc</td><td>Approximate Coordinate</td><td>Default: 0.000000</td></tr><tr><td>Y</td><td>Floating point</td><td>Yc</td><td>Approximate Coordinate</td><td>Default: 0.000000</td></tr><tr><td>Z</td><td>Floating point</td><td>Zc</td><td>Approximate Coordinate</td><td>Default: 0.000000</td></tr><tr><td>X</td><td>Floating point</td><td>Xt</td><td>Approximate Coordinate</td><td>Default: 0.000000</td></tr><tr><td>Y</td><td>Floating point</td><td>Yt</td><td>Approximate Coordinate</td><td>Default: 0.000000</td></tr><tr><td>Z</td><td>Floating point</td><td>Zt</td><td>Approximate Coordinate</td><td>Default: 0.000000</td></tr><tr><td>Output Text File</td><td>File path</td><td>OUTPUT FILE</td><td>The file to write the Calculation Results to.</td><td></td></tr></table>